﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using NetBay.Core.BusinessEntities;
using NetBay.Core.Log;
using Rio.Doc.Business.Repository.Translator;
using Rio.Doc.DataAccess;
using Rio.Framework.Business;
using NetBay.Core.BusinessEntities.Historic;



namespace Rio.Doc.Business.Repository
{
    public class HistoricInfoRepository
    {
       
        /// <summary>b
        /// Call History Past consultations 
        /// </summary>
        /// <param name="p_lUserId"></param>
        /// <param name="p_iNbLine"></param>
        /// <returns></returns>
        public static List<HistoricInformation> GetLastConsultations(string p_sAction, long p_lUserId, int p_iNbLine, bool  p_bSearchSave)
        {
            var l_lHistoricInfoResult = new List<HistoricInformation>();
            l_lHistoricInfoResult = HistoricInfoTranslator.TranslateHistoric(DA_HistoricInfo.GetHistoricConsultation(p_sAction, p_lUserId, p_iNbLine, p_bSearchSave));
            return l_lHistoricInfoResult;
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="p_lIdentifier"></param>
        public static void DeleteHistoricSearcSave(long p_lIdentifier)
        {
           
            try
            {
                DA_HistoricInfo.DeleteHistoricSearcSave(p_lIdentifier);
            }
            catch (Exception ex)
            {
                LogManager.Instance().LogError(ex.Message);
            }

        }

       
        
    }
}
